package Student;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

public class Salary {
	public static final int x = 20;// 优秀20元
	public static final int y = 15;// 及格15元
	public static Double taxRate = null;// 税率
	public static final int weekCount = 5;// 总周数
	public static Map<String, List<Student>> roomStudentMap = null;
	
	public static void dePartureRoom(Student Student, Lab Classroom) {
		System.out.println( Classroom.getClassroom() + "分配给:" + Student.getStuName() + "");
		String RoomID = Classroom.getRoomID();
		if (roomStudentMap == null) {
			roomStudentMap = new HashMap<String, List<Student>>();
		    List<Student> studentIdList = new ArrayList<Student>();
		    studentIdList.add(Student);
		    roomStudentMap.put(RoomID, studentIdList);
		    } 
		else {
		  if (roomStudentMap.get(RoomID) == null) {
		   List<Student> studentIdList = new ArrayList<Student>();
		   studentIdList.add(Student);
		   roomStudentMap.put(RoomID, studentIdList);
		  } 
		  else {
		   List<Student> studentIdList = roomStudentMap.get(RoomID);
		   studentIdList.add(Student);
		   roomStudentMap.put(RoomID, studentIdList);
		  }
		}
	}
	
	public static void calculateAccout(Student student) {
		  int excelentCount = student.getExcellentCount();
		  int passCount = student.getPassCount();
		  int priceBefore = x * excelentCount + y * passCount;
		  System.out.println(student.getStuName() + "勤工俭学收入:" + priceBefore);
		  double price = priceBefore - priceBefore * taxRate;
		  System.out.println(student.getStuName() + "税后实际收入:" + price);
		 }
}
